import { Injectable } from '@angular/core';
import { HOSTURL, PREFIX } from '../../../config';
import { RequestClientService } from '../../request-client.service';

@Injectable({
  providedIn: 'root'
})
export class PersonInfoService {

  constructor(
    private requestClientService: RequestClientService
  ) { }
  // 获取检查-分页数据集合
  // public async QueryProjectUserPagedList(params) {
  //   const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/QianBian/QueryProjectUserPagedList`, params);
  //   return res;
  // }
  // 创建或编辑班组管理
  public async CreateOrModifyTeam(params) {
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/CreateOrModifyTeam`, params);
    return res;
  }
  // 获取班组管理分页数据
  public async QueryTeamsPagedList(params) {
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryTeamsPagedList`, params);
    return res;
  }
   // 获取工种分页数据
   public async QueryMajorsPagedList(params) {
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryMajorsPagedList`, params);
    return res;
  }
  // 创建或编辑工种
  public async CreateOrModifyMajor(params) {
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/CreateOrModifyMajor`, params);
    return res;
  }
  // 删除团队
  public async RemoveTeam(params) {
    const res = await this.requestClientService.delete(HOSTURL + `/api/services/${PREFIX}/ThirdParty/RemoveTeam`, params);
    return res;
  }
  // 删除工种
  public async RemoveMajor(params) {
    const res = await this.requestClientService.delete(HOSTURL + `/api/services/${PREFIX}/ThirdParty/RemoveMajor`, params);
    return res;
  }


  // 获取项目人员考勤详情
  public async QueryProjectUserAttendancesPagedList(params) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryProjectUserAttendancesPagedList`, params);
    return res;
  }
  // 获取项目人员信息
  public async QueryProjectUsersPagedList(params) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/QueryProjectUsersPagedList`, params);
    return res;
  }
  // 编辑项目人员扩展信息
  public async ModifyProjectUsers(params) {
    // tslint:disable-next-line:max-line-length
    const res = await this.requestClientService.post(HOSTURL + `/api/services/${PREFIX}/ThirdParty/ModifyProjectUsers`, params);
    return res;
  }

}
